# 第 0015 题： 纯文本文件 city.txt为城市信息, 里面的内容（包括花括号）如下所示：
from  openpyxl import  Workbook 
import string
import json

def city_excle(cityDate,title,target):
    wb = Workbook()
    ws=wb.active
    ws.title=title
    for k,v in cityDate.items():
        ws[string.ascii_uppercase[0]+k]=k
        ws[string.ascii_uppercase[1]+k]=v
    wb.save(target)



if __name__=='__main__':
    with open('resource/excel/city.txt',encoding='utf-8') as f:
        cityDate=json.load(f)
        print(cityDate)
        city_excle(cityDate,'city','resource/excel/city.xlsx')